<?php
namespace Home\Controller;
use Think\Controller;

class UserController extends CommonController {
	
    public function index(){
    	$uid = is_login();

    	if (IS_POST) {
    		# code...
    		$ret = D('Member')->editUser($uid,I('nickname'),I('email'),'',I('qq'),I('mobile'),I('description'));
    		if($ret !== false){
				$this->success('2201:修改成功！');
			}elseif($ret == -2){
				$this->error('参数错误');
			}elseif($ret == -1){
				$this->error(D('Member')->getError());
			}else{
				$this->error('3201:修改失败！');
			}
    	}else{
	    	$member = M('Member')->where(array('uid'=>$uid,'status'=>1))->find();
	    	
	    	$this->assign('member',$member);
	        $this->display();
    	}

    }

	//收藏夹
    public function edit_img(){
    	$this->display();
    }

    public function password(){
    	$this->display();
    }
}